/**
 * 
 */
package dms.model.role;

/**
 * @author 李健
 *
 */
public class Role {
	
	public static final Role SYSTEM_ADMINISTRATOR = new Role("SYSTEM_ADMINISTRATOR");
	
	public static final Role DORM_SUPERVISOR = new Role("DORM_SUPERVISOR");
	
	public static final Role STUDENT_AFFAIR_TEACHER = new Role("STUDENT_AFFAIR_TEACHER");
	
	public static final Role STUDENT = new Role("STUDENT");
	
	private String roleName;

	/**
	 * @return the roleName
	 */
	public String getRoleName() {
		return roleName;
	}

	/**
	 * @param roleName the roleName to set
	 */
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	/**
	 * 
	 */
	public Role() {
		super();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((roleName == null) ? 0 : roleName.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Role other = (Role) obj;
		if (roleName == null) {
			if (other.roleName != null)
				return false;
		} else if (!roleName.equals(other.roleName))
			return false;
		return true;
	}

	/**
	 * @param roleName
	 */
	public Role(String roleName) {
		super();
		this.roleName = roleName;
	}
	
	
}
